package com.wyclabs.article;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Nacos
 * @author rs
 * @date 2019/8/2 17:20
 */
@SpringBootApplication(scanBasePackages = "com.wyclabs")
@EnableDiscoveryClient
@EnableAsync
@EnableSwagger2
public class ArticleApp {

    public static void main(String[] args) {
        SpringApplication.run(ArticleApp.class, args);
    }

    @RestController
    public class EchoController {
        @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)
        public String echo(@PathVariable String string) {
            return "Hello Nacos Discovery " + string;
        }
    }

}
